import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import iView from 'iview';
import 'iview/dist/styles/iview.css';
Vue.use(iView);

Vue.config.productionTip = false;

// from-data序列化
Vue.prototype.$qs = params => require('qs').stringify(params)

// router.beforeEach((to, from, next) => {
//     if (to.meta.requireAuth) {
//         if (window.localStorage.getItem('token')) {
//             next()
//         } else {
//             next({
//                 path: '/login',
//                 query: {redirect: to.fullPath}
//             })
//         }
//     }
//     else {
//         next()
//     }
// })

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
